<ion-view id="sort-manage" view-title="分类管理"  hide-nav-bar="true">
  <ion-header-bar align-title="center" class="bar-calm">
    <div class="buttons">
      <button class="button head-button button-clear center-btn" ng-click="goBack()">
        <img src="img/order-commit/backIcon.png">
      </button>
    </div>
    <h1 class="title">分类管理</h1>
  </ion-header-bar>
  <ion-content>
    <div class="head-div">
        <label class="item item-input" style="padding-bottom:1px;">
            <input type="text" ng-model="postSortData.sortname" placeholder="请输入分类名称">
        </label>
        <label class="item item-input" style="padding-bottom:1px;position:relative;">
            <span class="select-sort" on-tap="showSortsModal()" ng-if="!$storage.checkSort">
              所属分类<span style="margin-left: 6px;" class="ion-ios-arrow-down"></span>
            </span>
            <span class="select-sort" on-tap="showSortsModal()" ng-if="$storage.checkSort">
              {{$storage.checkSort.name}}
            </span>
            <div class="right" ng-if="$storage.checkSort" on-tap="goDeleteChecksort()"></div>
        </label>
        <!--<label class="item item-input" style="padding-bottom:14px;">-->
            <!--<input type="text" ng-model="postSortData.sortorder" placeholder="输入排序的数字">-->
        <!--</label>-->
    </div>
      <div class="sort-list">
        <div class="sort-record" ng-repeat="first in $storage.Allsort">
          <span style="display: none">{{i = $index}}</span>
          <div class="first-sort">
            <div class="left-part" ng-class="{true:'red-down-arrow',false:'red-right-arrow'}[first.show==true]"
                 on-tap="showSecondChild(first)">{{first.firstsortname}}</div>
            <div class="right-part">
              <div class="right-btn remove" on-tap="goDeleteSortFirst(first,i)"></div>
              <div class="right-btn edit" on-tap="goEditSortFirst(first)"></div>
              <div class="right-btn movedown" on-tap="move(first.firstsortid,'','','down')"></div>
              <div class="right-btn moveup" on-tap="move(first.firstsortid,'','','up')"></div>
            </div>
          </div>
          <div class="second-sort-record" ng-show="first.show"
               ng-repeat="second in first.childsort">
            <span style="display: none">{{j = $index}}</span>
            <div class="second-sort">
              <div class="left-part" ng-class="{true:'black-down-arrow',false:'black-right-arrow'}[second.show==true]"
                   on-tap="showSecondChild(second)">{{second.secondsortname}}</div>
              <div class="right-part">
                <div class="right-btn remove" on-tap="goDeleteSortSecond(second,i,j)"></div>
                <div class="right-btn edit" on-tap="goEditSortSecond(second,first)"></div>
                <div class="right-btn movedown" on-tap="move(first.firstsortid,second.secondsortid,'','down')"></div>
                <div class="right-btn moveup" on-tap="move(first.firstsortid,second.secondsortid,'','up')"></div>
              </div>
            </div>
            <div class="third-sort-record" ng-show="second.show"
                 ng-repeat="third in second.childsort">
              <span style="display: none">{{k = $index}}</span>
              <div class="third-sort">
                <div class="left-part">{{third.thirdsortname}}</div>
                <div class="right-part">
                  <div class="right-btn remove" on-tap="goDeleteSortThird(third,i,j,k)"></div>
                  <div class="right-btn edit" on-tap="goEditSortThird(third,second)"></div>
                  <div class="right-btn movedown"
                       on-tap="move(first.firstsortid,second.secondsortid,third.thirdsortid,'down')"></div>
                  <div class="right-btn moveup"
                       on-tap="move(first.firstsortid,second.secondsortid,third.thirdsortid,'up')"></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!--<div class="list first-list" ng-repeat="first in $storage.Allsort">-->
        <!--<span style="display: none">{{i = $index}}</span>-->
          <!--<div class="left-div" ng-click="showSecondChild(first)">-->
              <!--<div ng-class="{true:'left-down',false:'left-up'}[first.show]"></div>-->
              <!--<span class="right">{{first.firstsortname}}</span>-->
          <!--</div>-->
          <!--<div class="right-div">-->
              <!--<div class="left" ng-click="goEditSortFirst(first)"></div>-->
              <!--<div class="right" ng-click="goDeleteSortFirst(first,i)"></div>-->
          <!--</div>-->
          <!--<div ng-if="first.show" class="list second-list" ng-repeat="second in first.childsort">-->
            <!--<span style="display: none">{{j = $index}}</span>-->
              <!--<div class="left-div" ng-click="showThirdChild(second)">-->
                  <!--<div ng-class="{true:'left-down-dark',false:'left-up-dark'}[second.show]"></div>-->
                  <!--<span class="right">{{second.secondsortname}}</span>-->
              <!--</div>-->
              <!--<div class="right-div">-->
                  <!--<div class="left" ng-click="goEditSortSecond(second,first)"></div>-->
                  <!--<div class="right" ng-click="goDeleteSortSecond(second,i,j)"></div>-->
              <!--</div>-->
              <!--<div ng-if="second.show" class="list third-list" ng-repeat="third in second.childsort">-->
                <!--<span style="display: none">{{k = $index}}</span>-->
                  <!--<div class="left-div">-->
                      <!--<div class="left-up-dark"></div>-->
                      <!--<span class="right">{{third.thirdsortname}}</span>-->
                  <!--</div>-->
                  <!--<div class="right-div">-->
                      <!--<div class="left" ng-click="goEditSortThird(third,second)"></div>-->
                      <!--<div class="right" ng-click="goDeleteSortThird(third,i,j,k)"></div>-->
                  <!--</div>-->
              <!--</div>-->
          <!--</div>-->
      <!--</div>-->
      <div class="bottom-blank"></div>
  </ion-content>
    <div class="button button-clear foot-btn" ng-click="goaddSort()">
        添加分类
    </div>
</ion-view>